# -*- coding:utf-8 -*-
from tornado import gen

from appcommon.framework import APIRequestHandler
from user import models as userm


class DownloadHandler(APIRequestHandler):
    @gen.coroutine
    def get(self):
        last_version = yield userm.get_last_version(0)
        version = '1.0.3'
        if last_version:
            version = last_version['check_version']
        self.redirect('/media/apk/qicheng-{}.apk'.format(version))